import React, { Component } from 'react';
import PropTypes from 'prop-types'
import './Box.scss'
class Box extends Component {
    constructor(props) {
        super(props);
        this.state = {};
    }
    render() {
        let { title, smallTitle, children } = this.props;
        return (
            <>
                <div className='echarts-order'>
                    <div className='echarts-order-title'>
                        {title}
                    </div>
                    <div className='echarts-order-smtitle'>
                        {smallTitle}
                    </div>
                    <div className='echarts-order-content'>
                        {
                            Array.isArray(children) ?
                                React.Children.map(children, (child, index) => {
                                    return (
                                        <div key={index} className='box-children'>{child}</div>
                                    )
                                })
                                :
                                children
                        }
                    </div>
                </div>
            </>
        );
    }
}

Box.propTypes = {
    title: PropTypes.string,
    smallTitle: PropTypes.string
}
Box.defaultProps = {
    title: "",
    smallTitle: ""
}

export default Box;